<include file="Base/header" /> 	
<div class="page-container">
	<include file="Base/menu" /> 
	<div class="page-content">
		<div class="container-fluid">
			<div class="row-fluid">
					<div class="span12"> 
						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<h3 class="page-title">
						</h3>
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="/index.php/Admin/">首页</a> 
								<i class="icon-angle-right"></i>
							</li>
							<li><a href="#">设备转态管理</a></li>
							<i class="icon-angle-right"></i>
							<li><a href="#">详情</a></li>
						</ul>
						<!-- END PAGE TITLE & BREADCRUMB-->
					</div>
			</div>
			<div class="row-fluid">
				<div class="span12"> 
					<div class="portlet box blue tabbable">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-reorder"></i>
									<span class="hidden-480">详情</span>
							</div>
						</div>
					<div class="portlet-body form">
						<form  method="post" class="form-horizontal" id="formid">
							<input type="hidden" name="id" value="{$data.id}">
							<div class="control-group">
                        		<label class="control-label">设备名称</label>
                                <div class="controls">
                                    <input name="name" value="{$data.name}" type="text" class="m-wrap large">
                                </div>
                            </div>
                            <div class="control-group">
                        		<label class="control-label">设备一级状态</label>
                                <div class="controls">
                                	<input name="one_sta" value="{$data.one_sta}" type="text" class="m-wrap large">
                                </div>
                            </div>
                            <div class="control-group">
                        		<label class="control-label">设备二级状态</label>
                                <div class="controls">
                                	<input name="two_sta" value="{$data.two_sta}" type="text" class="m-wrap large">
                                </div>
                            </div>
                            <if condition="$unnor_photo['add_time'] eq $data['add_time']">
                                <div class="control-group">
                                    <label class="control-label">设备三级状态</label>
                                    <div class="controls">
                                        <input name="two_sta" value="{$unnor_photo.name}" type="text" class="m-wrap large">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">异常状态照片</label>
                                    <div class="controls">
                                        <div class="m-wrap large">
                                            <img src="{unnor_photo.photo_id}" style="width:400px;height: 300px;">
                                        </div>
                                    </div>
                                </div>

                            </if>

                            <div class="control-group">
                        		<label class="control-label">是否异常</label>
                                <div class="controls">
                                	<input name="is_normal" value="{$data.is_normal|isNormal}" type="text" class="m-wrap large">
                                </div>
                            </div>
                            <div class="control-group">
                        		<label class="control-label">图片</label>
                                <div class="controls">
                                <if condition="data['img']">
                                <div class="m-wrap large">
                                    <img src="{data.img}" style="width:400px;height: 300px;">
                                </div>
                                </if>
                                </div>
                            </div>
                            
						</form>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</div>
<include file="Base/footer" />
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">

$("#submit").click(function(){
	
	var data=$('#formid').serialize();
   	$.ajax({
   		type:'POST',
   		dataType: "json",
        url: "{:U('Admin/Shop/edit')}",
        data: data,
        success:  function(result){
        	if(result.status==1){
                layer.alert(result.info,function(){self.location="__MODULE__/Shop/index";});
            }else if(result.status==0){
                //失败
                layer.alert(result.info);
            }
        }
    });
});

</script>
